import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class test03 {
    public static void main(String[] args) {
        ArrayList<String> actor1 = new ArrayList<>();
        ArrayList<String> actor2 = new ArrayList<>();
        Collections.addAll(actor1, "蔡坤坤,24", "叶齁咸,23", "刘不甜,22", "吴签,24", "谷嘉,30", "肖梁梁,27");
        Collections.addAll(actor2, "赵小颖,35", "杨颖,36", "高元元,43", "张天天,31", "刘诗,35", "杨小幂,33");
        Stream<String> stream1 = actor1.stream().filter(s -> s.split(",")[0].length() == 3).limit(2);
        Stream<String> stream2 = actor2.stream().filter(s -> s.split(",")[0].startsWith("杨")).skip(1);
//        List<Actor> collect1 = Stream.concat(stream1, stream2).map(new Function<String, Actor>() {
//            @Override
//            public Actor apply(String s) {
//                String[] str = s.split(",");
//                return new Actor(str[0], str[1]);
//            }
//        }).collect(Collectors.toList());
        List<Actor> collect2 = Stream.concat(stream1, stream2).map(s -> new Actor(s.split(",")[0], s.split(",")[1])).collect(Collectors.toList());
        System.out.println(collect2);
    }
}
